Optimal. Leaf size=98 \[ \frac {2 i a^2 (a+i a \tan (c+d x))^{n-2} (e \sec (c+d x))^{4-2 n}}{d \left (n^2-5 n+6\right )}+\frac {i a (a+i a \tan (c+d x))^{n-1} (e \sec (c+d x))^{4-2 n}}{d (3-n)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.13, antiderivative size = 98, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 30, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.067, Rules used = {3494, 3493} \[ \frac {2 i a^2 (a+i a \tan (c+d x))^{n-2} (e \sec (c+d x))^{4-2 n}}{d \left (n^2-5 n+6\right )}+\frac {i a (a+i a \tan (c+d x))^{n-1} (e \sec (c+d x))^{4-2 n}}{d (3-n)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3493
Rule 3494
Rubi steps
\begin {align*} \int (e \sec (c+d x))^{4-2 n} (a+i a \tan (c+d x))^n \, dx &=\frac {i a (e \sec (c+d x))^{4-2 n} (a+i a \tan (c+d x))^{-1+n}}{d (3-n)}+\frac {(2 a) \int (e \sec (c+d x))^{4-2 n} (a+i a \tan (c+d x))^{-1+n} \, dx}{3-n}\\ &=\frac {2 i a^2 (e \sec (c+d x))^{4-2 n} (a+i a \tan (c+d x))^{-2+n}}{d \left (6-5 n+n^2\right )}+\frac {i a (e \sec (c+d x))^{4-2 n} (a+i a \tan (c+d x))^{-1+n}}{d (3-n)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 1.24, size = 91, normalized size = 0.93 \[ \frac {e^4 \sec ^2(c+d x) ((n-2) \tan (c+d x)-i (n-4)) (\cos (2 (c+d x))-i \sin (2 (c+d x))) (a+i a \tan (c+d x))^n (e \sec (c+d x))^{-2 n}}{d (n-3) (n-2)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.68, size = 134, normalized size = 1.37 \[ \frac {{\left ({\left (-i \, n + 3 i\right )} e^{\left (4 i \, d x + 4 i \, c\right )} + {\left (-i \, n + 4 i\right )} e^{\left (2 i \, d x + 2 i \, c\right )} + i\right )} \left (\frac {2 \, e e^{\left (i \, d x + i \, c\right )}}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}\right )^{-2 \, n + 4} e^{\left (i \, d n x + i \, c n - 4 i \, d x + n \log \left (\frac {2 \, e e^{\left (i \, d x + i \, c\right )}}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}\right ) + n \log \left (\frac {a}{e}\right ) - 4 i \, c\right )}}{2 \, {\left (d n^{2} - 5 \, d n + 6 \, d\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (e \sec \left (d x + c\right )\right )^{-2 \, n + 4} {\left (i \, a \tan \left (d x + c\right ) + a\right )}^{n}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [F] time = 2.04, size = 0, normalized size = 0.00 \[ \int \left (e \sec \left (d x +c \right )\right )^{4-2 n} \left (a +i a \tan \left (d x +c \right )\right )^{n}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 1.26, size = 594, normalized size = 6.06 \[ \frac {8 \, {\left (\cos \left (2 \, d x + 2 \, c\right )^{2} + \sin \left (2 \, d x + 2 \, c\right )^{2} + 2 \, \cos \left (2 \, d x + 2 \, c\right ) + 1\right )}^{\frac {1}{2} \, n} a^{n} e^{4} \cos \left (n \arctan \left (\sin \left (2 \, d x + 2 \, c\right ), \cos \left (2 \, d x + 2 \, c\right ) + 1\right )\right ) + 8 i \, {\left (\cos \left (2 \, d x + 2 \, c\right )^{2} + \sin \left (2 \, d x + 2 \, c\right )^{2} + 2 \, \cos \left (2 \, d x + 2 \, c\right ) + 1\right )}^{\frac {1}{2} \, n} a^{n} e^{4} \sin \left (n \arctan \left (\sin \left (2 \, d x + 2 \, c\right ), \cos \left (2 \, d x + 2 \, c\right ) + 1\right )\right ) - 8 \, {\left (a^{n} e^{4} n - 3 \, a^{n} e^{4}\right )} {\left (\cos \left (2 \, d x + 2 \, c\right )^{2} + \sin \left (2 \, d x + 2 \, c\right )^{2} + 2 \, \cos \left (2 \, d x + 2 \, c\right ) + 1\right )}^{\frac {1}{2} \, n} \cos \left (2 \, d x + n \arctan \left (\sin \left (2 \, d x + 2 \, c\right ), \cos \left (2 \, d x + 2 \, c\right ) + 1\right ) + 2 \, c\right ) - {\left (8 i \, a^{n} e^{4} n - 24 i \, a^{n} e^{4}\right )} {\left (\cos \left (2 \, d x + 2 \, c\right )^{2} + \sin \left (2 \, d x + 2 \, c\right )^{2} + 2 \, \cos \left (2 \, d x + 2 \, c\right ) + 1\right )}^{\frac {1}{2} \, n} \sin \left (2 \, d x + n \arctan \left (\sin \left (2 \, d x + 2 \, c\right ), \cos \left (2 \, d x + 2 \, c\right ) + 1\right ) + 2 \, c\right )}{{\left ({\left (-i \, e^{2 \, n} n^{2} + 5 i \, e^{2 \, n} n - 6 i \, e^{2 \, n}\right )} 2^{n} \cos \left (6 \, d x + 6 \, c\right ) + {\left (-3 i \, e^{2 \, n} n^{2} + 15 i \, e^{2 \, n} n - 18 i \, e^{2 \, n}\right )} 2^{n} \cos \left (4 \, d x + 4 \, c\right ) + {\left (-3 i \, e^{2 \, n} n^{2} + 15 i \, e^{2 \, n} n - 18 i \, e^{2 \, n}\right )} 2^{n} \cos \left (2 \, d x + 2 \, c\right ) + {\left (e^{2 \, n} n^{2} - 5 \, e^{2 \, n} n + 6 \, e^{2 \, n}\right )} 2^{n} \sin \left (6 \, d x + 6 \, c\right ) + 3 \, {\left (e^{2 \, n} n^{2} - 5 \, e^{2 \, n} n + 6 \, e^{2 \, n}\right )} 2^{n} \sin \left (4 \, d x + 4 \, c\right ) + 3 \, {\left (e^{2 \, n} n^{2} - 5 \, e^{2 \, n} n + 6 \, e^{2 \, n}\right )} 2^{n} \sin \left (2 \, d x + 2 \, c\right ) + {\left (-i \, e^{2 \, n} n^{2} + 5 i \, e^{2 \, n} n - 6 i \, e^{2 \, n}\right )} 2^{n}\right )} d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 5.93, size = 174, normalized size = 1.78 \[ \frac {4\,e^4\,{\left (\frac {a\,\left (\cos \left (2\,c+2\,d\,x\right )+1+\sin \left (2\,c+2\,d\,x\right )\,1{}\mathrm {i}\right )}{\cos \left (2\,c+2\,d\,x\right )+1}\right )}^n\,\left (4\,\sin \left (2\,c+2\,d\,x\right )+\cos \left (2\,c+2\,d\,x\right )\,4{}\mathrm {i}+\cos \left (4\,c+4\,d\,x\right )\,1{}\mathrm {i}-n\,1{}\mathrm {i}+\sin \left (4\,c+4\,d\,x\right )-n\,\cos \left (2\,c+2\,d\,x\right )\,1{}\mathrm {i}-n\,\sin \left (2\,c+2\,d\,x\right )+3{}\mathrm {i}\right )}{d\,{\left (\frac {e}{\cos \left (c+d\,x\right )}\right )}^{2\,n}\,\left (4\,\cos \left (2\,c+2\,d\,x\right )+\cos \left (4\,c+4\,d\,x\right )+3\right )\,\left (n^2-5\,n+6\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (e \sec {\left (c + d x \right )}\right )^{4 - 2 n} \left (i a \left (\tan {\left (c + d x \right )} - i\right )\right )^{n}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________